package thread;

public class ThreadDemo1 {
    public static void main(String[] args) {
        //多态表明是一个线程 同时运行for循环
        Thread t1 = new MyThread1();
        Thread t2 = new MyThread2();
        //由线程调度器开始调度线程执行run()中的业务并不是直接调用run()方法
        t1.start();
        t2.start();
    }
}
class MyThread1 extends Thread{
    public void run(){
        for (int i = 0; i < 1000; i++) {
            System.out.println("你是谁呀?");
        }
    }
}
class MyThread2 extends Thread{
    public void run(){
        for (int i = 0; i < 1000; i++) {
            System.out.println("我是你爹!");
        }
    }
}